/* Fix Bootstrap dropdown position when inside a input-group */
.input-group > .uix-select.dropdown {
    /* Instead of relative */
    position: static;
}

.input-group > .uix-select > input.uix-select-search.form-control {
    border-radius: 4px; /* FIXME hardcoded value :-/ */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .uix-select > input.uix-select-search.form-control {
    border-radius: 4px !important; /* FIXME hardcoded value :-/ */
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body > .uix-select.open {
    z-index: 1000; /* Standard Bootstrap dropdown z-index */
}

.uix-select {
    .uix-select-allowclear {
        margin-right: 10px;
        line-height:1;
    }
    .uix-select-highlight {
        font-weight: bold;
    }
    /* Helper class to show styles when focus */
    .uix-select-focus {
        color: #333;
        background-color: #EBEBEB;
        border-color: #ADADAD;
        text-decoration: none;
        outline: 5px auto -webkit-focus-ring-color;
        outline-offset: -2px;
        box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
    }
    .uix-select-toggle {
        position: relative;
        outline: 0;
        height: 30px;
        overflow-x: hidden;
    }
    .uix-select-toggle > .caret {
        position: absolute;
        height: 10px;
        top: 50%;
        right: 10px;
        margin-top: -2px;
    }
    .uix-select-match > .btn {
        /* Instead of center because of .btn */
        text-align: left !important;
    }
    .uix-select-match > .caret {
        position: absolute;
        top: 45%;
        right: 15px;
    }
    .uix-select-choices {
        height: auto;
        width: 100%;
        max-height: 200px;
        overflow-x: hidden;
        margin-top: -1px;
    }
    .uix-select-choices-row > a {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 3px 20px;
        clear: both;
        font-weight: 400;
        line-height: 1.42857143;
        color: #333;
    }
    .uix-select-choices-row > a:hover,
    .uix-select-choices-row > a:focus {
        text-decoration: none;
        color: #262626;
        background-color: #f5f5f5;
    }
    .uix-select-choices-row.active > a {
        color: #fff;
        text-decoration: none;
        outline: 0;
        background-color: #428bca;
    }
    .uix-select-choices-row.disabled > a,
    .uix-select-choices-row.active.disabled > a {
        color: #777;
        cursor: not-allowed;
        background-color: #fff;
    }
    .uix-select-match.ng-hide-add,
    .uix-select-search.ng-hide-add {
        display: none !important;
    }
    &.ng-dirty.ng-invalid > button.btn.uix-select-match {
        border-color: #D44950;
    }
    &.direction-up .uix-select-dropdown {
        box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
    }
    .uix-select-offscreen {
        clip: rect(0 0 0 0) !important;
        width: 1px !important;
        height: 1px !important;
        border: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        outline: 0 !important;
        left: 0 !important;
        top: 0 !important;
    }
}

.uix-select-multiple {
    height: auto;
    padding: 3px 3px 0 3px;
    &.uix-select input.uix-select-search {
        background-color: transparent !important; /* To prevent double background when disabled */
        border: none;
        outline: none;
        height: 1.666666em;
        margin-bottom: 3px;
    }
    &.uix-select .uix-select-match .close {
        font-size: 1.6em;
        line-height: 0.75;
    }
    .uix-select-match-item {
        padding: 1px 10px;
        outline: 0;
        margin: 0 3px 3px 0;
        position: relative;
    }
    .uix-select-match-item.dropping-before:before {
        content: "";
        position: absolute;
        top: 0;
        right: 100%;
        height: 100%;
        margin-right: 2px;
        border-left: 1px solid #428bca;
    }
    .uix-select-match-item.dropping-after:after {
        content: "";
        position: absolute;
        top: 0;
        left: 100%;
        height: 100%;
        margin-left: 2px;
        border-right: 1px solid #428bca;
    }
}
